﻿using System;
using System.Threading.Tasks;
using WxLib.Core.Serializers;

namespace WxLib.Core.RequestHandlers
{
    /// <summary>
    ///     Interface for Request Handlers
    /// </summary>
    public interface IRequestHandler
    {
        /// <summary>
        ///  获取或设置用于反序列化响应数据的ISerializer
        /// </summary>
        ISerializer Serializer { get; set; }

        /// <summary>
        /// 对指定的URI执行GET请求，并返回反序列化的数据。
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="uri"></param>
        /// <returns></returns>
        Task<T> RequestAsync<T>(Uri uri);
    }
}